﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IList<JLL.China.Model.ProjectDirectoryMedia>>" %>
<table border="0" cellpadding="0" cellspacing="0" id="id-form" class="upload-image-table">
    <tr>
        <th valign="top" style="padding-right: 30px; width: 188px">
            <b>+ Cover image (Main) </b>
        </th>
        <td>
            <div style="text-align: left; min-width: 437px;">
                <!--label for="Filedata">Upload photo(s)</label-->
                <input type="file" name="Filedata" value="" id="upload-image-main" style="display: none" />
                <a class="upload-img-btn hide " id="btn-upload-image-main" href="javascript:$('#upload-image-main').uploadify('upload','*');"
                    style="float: left; margin-left: 278px;">Upload File(s)</a>
            </div>
        </td>
        <td valign="top">
        </td>
    </tr>
    <tr>
        <th valign="top" style="padding-right: 30px; width: 188px">
            <b>+ Site map </b>
        </th>
        <td>
            <div style="text-align: left; min-width: 437px;">
                <!--label for="Filedata">Upload photo(s)</label-->
                <input type="file" name="Filedata" value="" id="sitemap" style="display: none" />
                <a class="upload-img-btn hide " id="btn-upload-sitemap" href="javascript:$('#sitemap').uploadify('upload','*');"
                    style="float: left; margin-left: 278px;">Upload File(s)</a>
            </div>
        </td>
        <td valign="top">
        </td>
    </tr>
    <tr>
        <th valign="top" style="padding-right: 30px; width: 188px">
            <b>+ Amenties </b>
        </th>
        <td>
            <div style="text-align: left; min-width: 437px;">
                <!--label for="Filedata">Upload photo(s)</label-->
                <input type="file" name="Filedata" value="" id="amenties" style="display: none" />
                <a class="upload-img-btn hide " id="upload-amenties-btn" href="javascript:$('#amenties').uploadify('upload','*');"
                    style="float: left; margin-left: 278px;">Upload File(s)</a>
            </div>
        </td>
        <td valign="top">
        </td>
    </tr>
    <tr>
        <th valign="top" style="padding-right: 30px; width: 188px">
            <b>+ Facilities </b>
        </th>
        <td>
            <div style="text-align: left; min-width: 437px;">
                <!--label for="Filedata">Upload photo(s)</label-->
                <input type="file" name="Filedata" value="" id="facilities" style="display: none" />
                <a class="upload-img-btn hide " id="upload-facilities-btn" href="javascript:$('#facilities').uploadify('upload','*');"
                    style="float: left; margin-left: 278px;">Upload File(s)</a>
            </div>
        </td>
        <td valign="top">
        </td>
    </tr>
    <tr>
        <th valign="top" style="padding-right: 30px; width: 188px">
            <b>+ Surrounding </b>
        </th>
        <td>
            <div style="text-align: left; min-width: 437px;">
                <!--label for="Filedata">Upload photo(s)</label-->
                <input type="file" name="Filedata" value="" id="surrounding" style="display: none" />
                <a class="upload-img-btn hide " id="upload-surrounding-btn" href="javascript:$('#surrounding').uploadify('upload','*');"
                    style="float: left; margin-left: 278px;">Upload File(s)</a>
            </div>
        </td>
        <td valign="top">
        </td>
    </tr>
    <tr>
        <th valign="top" style="padding-right: 30px; width: 188px">
            <b>+ Other Images:</b>
        </th>
        <td>
            <div style="text-align: left; min-width: 437px;">
                <!--label for="Filedata">Upload photo(s)</label-->
                <input type="file" name="Filedata" value="" id="upload-photo" style="display: none" />
                <a class="upload-img-btn hide " id="upload-others-btn" href="javascript:$('#upload-photo').uploadify('upload','*');"
                    style="float: left; margin-left: 278px;">Upload File(s)</a>
            </div>
        </td>
        <td valign="top">
        </td>
    </tr>
    <tr>
        <td colspan="3">
            <div class="form_divider">
            </div>
        </td>
        <!--------------------------------------------------------------------->
    </tr>
    <tr>
        <td colspan="3">
            <div class="image_area" id="mediaphoto_content">
                <b>Project directory images</b>
                <div class="list">
                    <% if (this.Model.Count > 0)
                       {%>
                    <ul id="list1">
                        <%
                            string ImagePath = Url.Content("~/") + "Media/ProjectDirectory/";

                            foreach (var item in this.Model)
                            {
                        %>
                        <li data-itemid='<%= item.ID %>'>
                            <div>
                                <span><b> <%=item.ImgType %></b></span>
                            </div>
                            <div>
                                <img class="img_photo" src="<%=ImagePath+item.ListingsFID.ToString()+"/thumb/"+item.Filename%>" />
                            </div>
                            <div class="tools">
                                <div class="t-left">
                                    &nbsp;</div>
                                <div class="t-center">
                                   <%-- <% if (!item.IsDefault)
                                       {%>
                                    <a class="defaultlink info-tooltip" href="<%=Url.Content("~/")+ViewData["now_controller"]%>SetDefaultImg/<%=item.ID%>"
                                        title="Set this to default image">
                                        <img src="<%=Url.Content("~/Content/")%>images/icon_star_grey.png" name="" /></a>
                                    <% }
                                       else
                                       {%>
                                    <a class="defaultlink info-tooltip" href="<%=Url.Content("~/")+ViewData["now_controller"]%>SetDefaultImg/<%=item.ID%>"
                                        title="Default image">
                                        <img src="<%=Url.Content("~/Content/")%>images/icon_star.png" class="default" name="" />
                                    </a>
                                    <%} %>--%>
                                    <%if (!item.IsActive)
                                      {%>
                                    <a class="statuslink info-tooltip" href="<%=Url.Content("~/")+ViewData["now_controller"]%>ChangeStatusImg/<%=item.ID%>"
                                        title="Set to Active">
                                        <img src="<%=Url.Content("~/Content/")%>images/icon_inactive.png" name="" /></a>
                                    <% }
                                      else
                                      {%>
                                    <a class="statuslink info-tooltip" href="<%=Url.Content("~/")+ViewData["now_controller"]%>ChangeStatusImg/<%=item.ID%>"
                                        title="Set to Inactive">
                                        <img src="<%=Url.Content("~/Content/")%>images/icon_active.png" name="" /></a>
                                    <% }%>
                                    <a class="removelink info-tooltip" href="<%=Url.Content("~/")+ViewData["now_controller"]%>RemoveImg/<%=item.ID%>"
                                        title="Delete this image">
                                        <img src="<%=Url.Content("~/Content/")%>images/icon_delete.png" /></a> <a class="fancybox-button info-tooltip"
                                            rel="fancybox-button" href="<%=ImagePath+item.ListingsFID.ToString()+"/"+item.Filename%>"
                                            title="Zoom this image">
                                            <img src="<%=Url.Content("~/Content/")%>images/icon-zoom.png" /></a>
                                </div>
                                <div class="t-right">
                                    &nbsp;</div>
                            </div>
                        </li>
                        <%}     
                        %>
                    </ul>
                    <%}
                       else
                       { %>
                    <br />
                    <br />
                    <h4 style='color: #92B22C;'>
                        No images at the moment</h4>
                    <%} %>
                    <br style="clear: both;" />
                </div>
                <!--#list-->
            </div>
        </td>
    </tr>
</table>
